import java.sql.Array;
import java.util.*;

public class Test {
    public static void main(String[] args) {
        /*ArrayList<String> list=new ArrayList<>();
        list.add("java1");
        list.add("java1");
        list.add("java2");
        list.add("java3");
        list.add("java2");
        System.out.println(list);*/
        /*HashSet<String> set=new HashSet<>();
        set.add("java1");
        set.add("java2");
        set.add("java4");
        set.add("java2");
        set.add("java1");
        set.add("java1");
        System.out.println(set);*/

        Collection<String> c=new ArrayList<>();
        Collection<String> d=new ArrayList<>();
        c.add("java1");
        c.add("java1");
        c.add("java2");
        c.add("java3");
        c.add("java2");
      //  d.addAll(c);
        Object[] arr2=c.toArray();
        System.out.println(Arrays.toString(arr2));
       /* System.out.println(c);
        System.out.println(d);*/
        //System.out.println(c);
       // c.clear();
        //System.out.println(c.isEmpty());
        //System.out.println(c.size());
      //  System.out.println(c.contains("java1"));
      /*  System.out.println(c.remove("java1"));
        System.out.println(c);*/
    }
}
